<template>
  <a-radio-group
    v-model:value="value1"
    :button-style="buttonStyle"
    :disabled="disabled"
    :name="name"
    :options="options"
    :option-type="optionType"
    :size="size"
  >
    <slot />
  </a-radio-group>
</template>
<script>
import { defineComponent, computed } from 'vue'
import { RadioGroup } from 'ant-design-vue'
export default defineComponent({
  name: 'ZRadioGroup',
  components: {
    ARadioGroup: RadioGroup
  },
  props: {
    value: {
      type: [String, Boolean, Array],
      default: ''
    },
    disabled: Boolean,
    buttonStyle: {
      type: String,
      default: 'outline'
    },
    name: {
      type: String,
      default: ''
    },
    options: {
      type: [String, Array],
      default() {
        return []
      }
    },
    optionType: {
      type: String,
      default: 'default'
    },
    size: {
      type: String,
      default: 'default'
    }
  },
  setup(props, _ref) {
    const value1 = computed({
      get() {
        return props.value
      },
      set(val) {
        _ref.emit('update:value', val)
      }
    })
    return {
      value1
    }
  }
})
</script>
